import request from '@/utils/request'

// 查询用户优惠卷领取记录列表
export function getCouponRecordList(params) {
  return request({
    url: '/front/flat/coupon/record/list',
    method: 'get',
    params
  })
}

// 统计优惠券使用状态数量
export function countCouponRecordState(params) {
  return request({
    url: '/front/flat/coupon/record/countState',
    method: 'get',
    params
  })
}

// 新增优惠卷领取记录信息
export function addCouponRecord(data) {
  return request({
    url: '/front/flat/coupon/record',
    method: 'post',
    data
  })
}

// 核销优惠卷
export function verificationCouponRecord(data) {
  return request({
    url: '/front/flat/coupon/record/verification',
    method: 'post',
    data
  })
}

// 领券中心查询优惠卷列表
export function getCouponList(params) {
  return request({
    url: '/front/flat/coupon/coupon/page',
    method: 'get',
    params
  })
}

// 根据房间id查询用户优惠卷信息
export function getCouponByHouseId(params) {
  return request({
    url: '/front/flat/coupon/coupon/houseId',
    method: 'get',
    params
  })
}

// 根据房间id查询用户可用/不可用优惠卷信息
export function getCouponByHouseIdUseState(params) {
  return request({
    url: '/front/flat/coupon/record/houseId',
    method: 'get',
    params
  })
}

// 优惠券活动列表
export function getCouponActivityList(params) {
  return request({
    url: '/front/apartment/allocation/couponId',
    method: 'get',
    params
  })
}
